﻿using System;
using MessagePack.Internal;

namespace MessagePack.Decoders
{
	// Token: 0x020000E0 RID: 224
	internal class FixExt8DateTime : IDateTimeDecoder
	{
		// Token: 0x06000341 RID: 833 RVA: 0x0000C43D File Offset: 0x0000A83D
		private FixExt8DateTime()
		{
		}

		// Token: 0x06000342 RID: 834 RVA: 0x0000C448 File Offset: 0x0000A848
		public DateTime Read(byte[] bytes, int offset, out int readSize)
		{
			sbyte b = (sbyte)bytes[offset + 1];
			if ((int)b != -1)
			{
				throw new InvalidOperationException(string.Format("typeCode is invalid. typeCode:{0}", b));
			}
			ulong num = (ulong)bytes[offset + 2] << 56 | (ulong)bytes[offset + 3] << 48 | (ulong)bytes[offset + 4] << 40 | (ulong)bytes[offset + 5] << 32 | (ulong)bytes[offset + 6] << 24 | (ulong)bytes[offset + 7] << 16 | (ulong)bytes[offset + 8] << 8 | (ulong)bytes[offset + 9];
			long num2 = (long)(num >> 34);
			ulong num3 = num & 17179869183UL;
			readSize = 10;
			return DateTimeConstants.UnixEpoch.AddSeconds(num3).AddTicks(num2 / 100L);
		}

		// Token: 0x040000FA RID: 250
		internal static readonly IDateTimeDecoder Instance = new FixExt8DateTime();
	}
}
